{{define "Title"}}{{.user.Username}}{{end}}
{{define "ContentWidth"}}9{{end}}
{{define "Breadcrumb"}}
<ul class="breadcrumb">
  <li><a href="/"><i class="glyphicon glyphicon-home"></i> 首页</a></li>
  <li class="active">{{.user.Username}}</li>
</ul>
{{end}}
{{define "Content"}}
{{$user := .utils.AssertUser .user}}
<div class="content">
  <img src="{{$user.AvatarImgSrc 96}}" class="pull-left img-rounded" style="margin-right: 20px;">
  <h3>{{$user.Username}}</h3>
	{{if $.curr_user.IsSuperuser}}
	  {{if $user.IsBlocked}}
			<span class="label label-danger">已禁言</span>
	  {{else}}
			<a href="/account/{{$user.Username}}/block" class="btn btn-danger btn-xs" title="禁言"><i class="fa fa-hand-paper-o"></i></a>
	  {{end}}
	{{end}}
  {{if $user.Tagline}}
  <h3><small>{{$user.Tagline}}</small></h3>
  {{end}}
  <h4><small>Golang China 第 {{$user.Index}} 号会员，加入于 {{formattime $user.JoinedAt}}</small></h4>
  <!--
	  {{if .username}}
	  {{if $user.IsFollowedBy .username | not}}
	  <a href="/follow/{{$user.Username}}" class="btn btn-success"><i class="icon-plus icon-white"></i> 关注</a>
	  {{else}}
	  <div class="btn-group">
		<button class="btn disabled"><i class="icon-ok icon-white"></i> 已关注</button>
		<a href="/unfollow/{{$user.Username}}" class="btn btn-danger"><i class="icon-remove icon-white"></i> 取消</a>
	  </div>
	  {{end}}
	  {{end}}
	  -->
  <div class="clearfix"></div>
  <hr>
  <ul class="list-unstyled">
	{{if $user.Location}}
	<li>
	  <i class="fa fa-map-marker"></i>
	  <a href="/members/city/{{$user.Location}}">{{$user.Location}}</a>
	</li>
	{{end}}
	{{if $user.Website}}
	<li>
	  <i class="fa fa-globe"></i>
	  <a href="{{url $user.Website}}" target="_blank">{{$user.Website}}</a>
	</li>
	{{end}}
	{{if $user.Weibo}}
	<li>
	  <i class="fa fa-weibo"></i>
	  <a href="http://weibo.com/{{$user.Weibo}}" target="_blank">http://weibo.com/{{$user.Weibo}}</a>
	</li>
	{{end}}
	{{if $user.GitHubUsername}}
	<li>
	  <i class="fa fa-github"></i>
	  <a href="https://github.com/{{$user.GitHubUsername}}" target="_blank">https://github.com/{{$user.GitHubUsername}}</a>
	</li>
	{{end}}
  </ul>
  {{if $user.Bio}}
  <hr>
  {{$user.Bio}}
  {{end}}
</div>

<div class="content">
  <h4>{{$user.Username}}最近创建的主题</h4>
  <hr>
  <dl class="topics">
	{{range $user.LatestTopics .db}}
	{{$creater := .Creater $.db}}
	{{$node := .Node $.db}}
	<dd>
	  <a href="/member/{{$creater.Username}}" class="pull-left" style="margin-right: 10px;">
		<img src="{{$creater.AvatarImgSrc 48}}" class="img-rounded">
	  </a>
	  {{if .CommentCount}}
	  <a class="badge pull-right" href="/t/{{.Id_.Hex}}#.LatestReplyId.Hex">{{.CommentCount}}</a>
	  {{end}}
	  <a href="/t/{{.Id_.Hex}}" class="title">{{.Title}}</a>
	  <div class="space"></div>
	  <div class="info">
		<a class="label label-info" href="/go/{{$node.Id}}">{{$node.Name}}</a> •
		<a href="/member/{{$creater.Username}}"><strong>{{$creater.Username}}</strong></a> •
		{{if .CommentCount}}
		{{$latestReplier := .LatestReplier $.db}}
		{{formattime .LatestRepliedAt}} •
		最后回复来自 <a href="/member/{{$latestReplier.Username}}">{{$latestReplier.Username}}</a>
		{{else}}
		{{formattime .CreatedAt}}
		{{end}}
	  </div>
	  <div class="clear"></div>
	</dd>
	{{end}}
  </dl>
  {{if len ($user.LatestTopics .db)}}
  <a href="/member/{{$user.Username}}/topics">{{$user.Username}} 创建的更多主题</a>
  {{end}}
</div>
<div class="content">
  <h4>{{$user.Username}}最近回复了</h4>
  <hr>
  {{range $user.LatestReplies .db}}
  {{$topic := .Topic $.db}}
  {{$creater := $topic.Creater $.db}}
  <div class="reply">
	<span>
	  回复了 <a href="/member/{{$creater.Username}}">{{$creater.Username}}</a> 创建的主题: <a href="/t/{{$topic.Id_.Hex}}">{{$topic.Title}}</a>
	  <span class="pull-right">{{formattime .CreatedAt}}</span>
	</span>
	<div>
	  {{.Html}}
	</div>
  </div>
  {{end}}
  {{if len ($user.LatestReplies .db)}}
  <a href="/member/{{$user.Username}}/replies">{{$user.Username}} 创建的更多回复</a>
  {{end}}
</div>
{{end}}

{{define "LeftSide"}}{{end}}
{{define "RightSide"}}{{end}}
